import request from '@/utils/request'

// 查询借阅任务列表
export function listBorrowTask(query) {
  return request({
    url: '/archive/borrowTask/list',
    method: 'get',
    params: query
  })
}

// 查询借阅任务详细
export function getBorrowTask(taskId) {
  return request({
    url: '/archive/borrowTask/' + taskId,
    method: 'get'
  })
}

// 新增借阅任务
export function addBorrowTask(data) {
  return request({
    url: '/archive/borrowTask',
    method: 'post',
    data: data
  })
}

// 修改借阅任务
export function updateBorrowTask(data) {
  return request({
    url: '/archive/borrowTask',
    method: 'put',
    data: data
  })
}

// 删除借阅任务
export function delBorrowTask(taskId) {
  return request({
    url: '/archive/borrowTask/' + taskId,
    method: 'delete'
  })
}
export function selectArcBoxByTaskId(taskId) {
  return request({
    url: '/archive/borrowTask/selectArcBoxByTaskId/' + taskId,
    method: 'get'
  })
}
export function selectArcBoxById(taskId) {
  return request({
    url: '/archive/borrowTask/selectArcBoxById',
    method: 'post',
    data: taskId
  })
}
export function editBorrowTaskById(ids) {
  return request({
    url: '/archive/borrowTask/editBorrow',
    method: 'post',
    data: ids
  })
}

/**
 * 上报
 * @param data
 * @returns {*}
 */
export function report(data) {
  return request({
    url: '/archive/borrowTask/archiveBorrowTaskResultReport',
    method: 'post',
    data:data
  })
}
